package day06;

import java.io.File;

public class Demo13 {

	public static void main(String[] args) {

		File file=new File("test");
		boolean b=delete(file);
		System.out.println(b);
		
	}

	public static boolean delete(File dir) {
		
		if(!dir.exists()){
			return false;
		}
		
		
		File[] files = dir.listFiles();

		for (File f : files) {
			
			if(f.isDirectory()){
				delete(f);
			}
			
			f.delete();
		}
		return dir.delete();

	}
}
